package lua

//basic types
type Value interface{}
type TString string //TODO

type TValue struct {
	tk    int
	value Value
}

type locVar struct {
	varname TString
	startpc int //first point where variable is active
	endpc   int //first point where variable is dead
}

type upvalDesc struct {
	name    TString
	instack bool  //where it is in stack(register) -- local variable in uplevel func
	idx     uint8 //index of upvalue(in stack or in outer functions list
}

type Proto struct {
	numparams       uint8 // number of fixed parameters
	is_vararg       uint8 // 2: declared vararg 1: use vararg
	maxstacksize    uint8 // number of registers needed by the function
	linedefined     int   //debug information
	lastlinedefined int   //debug information
	code            []Instruction
	p               []*Proto    //functions defined in the function
	k               []TValue    //constants used by the function
	lineinfo        []int       //map from opcodes to source lines (debug information)
	locvars         []locVar    //local variables information(debug info)
	upvalues        []upvalDesc //upvalue information
	source          TString
}

type LClosure struct {
}
